function updatePwd(){
	var user_pwd = document.getElementById("user_pwd")
	var user_pwd1 = document.getElementById("user_pwd1")
	var oldPwd = document.getElementById("oldPwd")
	var oError = document.getElementById("other_err")
	if(user_pwd.value.length > 20 || user_pwd.value.length < 6) {
		oError.innerHTML = "密码请输入6-20位字符"
		
		return;
	}
	if(user_pwd1.value.length > 20 || user_pwd1.value.length < 6) {
		oError.innerHTML = "密码请输入6-20位字符"
		return;
	}
	if(oldPwd.value.length > 20 || oldPwd.value.length < 6) {
		oError.innerHTML = "密码请输入6-20位字符"
	
		return;
	}
	if(user_pwd.value!==user_pwd1.value){
		oError.innerHTML = "密码不一致！"
		
		return;
	}
	$.ajax({
		url:"http://114.55.145.243:8080/liantu/Login/UsersServlet/updatePwdByTel",
		data:$("form").serialize(),
		xhrFields: {
			withCredentials: true
		},
		success:function(data){
			if(data.status){
				alert("修改成功")
				location.reload()
			}
			else
				oError.innerHTML = data.msg;
		},
		dataType:"json"
	})
}


function updateImg(){
	
	$.ajax({
		url:"http://114.55.145.243:8080/liantu/Login/UsersServlet/updateImgByTel",
		data:$("#img").serialize(),
		xhrFields: {
			withCredentials: true
		},
		success:function(data){
			if(data.status){
				alert("修改成功")
				location.reload()
			}
			else
				oError.innerHTML = data.msg;
		},
		dataType:"json"
	})
}
